from django.db import models
from django.contrib.auth.models import AbstractUser
# Create your models here.
class MyUser(AbstractUser):
    MY_SEX = [
        ('男', '男'),
        ('女', '女'),
    ]
    MY_VIP = [
        ('VIP', 'VIP'),
        ('普通用户', '普通用户'),
    ]
    telephone = models.CharField(max_length=11,verbose_name="手机号",blank=True,null=True)
    head_img = models.ImageField(verbose_name="头像",upload_to="head_img",default="head_img/qq.jpg")
    sex = models.CharField(verbose_name="性别",choices=MY_SEX,max_length=2)
    vip = models.CharField(verbose_name="VIP",choices=MY_VIP,default="普通用户",max_length=8)

    class Meta:
        verbose_name = "用户"
        verbose_name_plural = "用户"
        # 自定义表名
        db_table = "my_user"